<template>
    <view-box style="background:#F3F6F7;">
      <div style="height:10px;"></div>
      <div class="width-border-baoc" v-if="yijing === 'yijing'">
        <div class="bouuwid" v-for="(item, index) in position"  :key="index" @click="$router.push('/radarmap?diof=' + item.id)">
          <p style="font-size:15px;">{{item.name}}</p>
          <p style="font-size:13px;color:#bababa;text-align: right;">{{item.created_at}}</p>
        </div>
      </div>
    <div class="width-border-baoc" v-if="yijing === 'pinggu'">
        <div class="bouuwid" v-for="(item, index) in assessment"  :key="index" @click="$router.push('/assessment?idoui=' + item.id)">
          <p style="font-size:15px;">{{item.sort.name}}</p>
          <p style="font-size:13px;color:#bababa;text-align: right;">{{item.created_at}}</p>
        </div>
      </div>
    </view-box>
</template>
<script>
import { ViewBox, Box, Flexbox, FlexboxItem, Group, Cell, CellBox, XHeader } from 'vux'
export default {
  components: {
    ViewBox,
    Box,
    Flexbox,
    Group,
    Cell,
    CellBox,
    FlexboxItem,
    XHeader
  },
  data () {
    return {
      position: {},
      timeNow: '',
      yijing: '',
      assessment: {}
    }
  },
  mounted () {
    this.yijing = this.$route.query.posu
    this.getMyYiSort()
    this.generateOrder()
  },
  computed: {
    userInfo () {
      return this.$store.getters.userInfo
    }
  },
  methods: {
    getMyYiSort () {
      this.$http.get('/getMyYiJing?sign=history').then(response => {
        this.position = response.data
      }).catch(error => {
        console.log(error)
      })
    },
    generateOrder () {
      this.loading = true
      this.$http.get('/GetAssessment/' + this.userInfo.id + '/history').then((response) => {
        this.assessment = response.data
      }).catch((error) => {
        console.log(error)
      })
    },
    subjectBuy (data) {
      console.log(data.is_power)
      this.$router.push({path: '/Answer?sort=' + data.id})
    }
  }
}
</script>
<style scoped>  
    .flex-demo{
        line-height: 1rem;
        margin-bottom: 0.2rem;
    }
    .flex-demo img{
        width: 0.67rem;
        height: 0.7rem;
    }
    .flex-demo p{
        line-height: 0.3rem;
        font-size: .1728rem;
    }
    .border-nav{
        border: 1px solid #ebebeb;
        width: 96%;
        margin-left: 2%;
        border-radius: .1rem;
        box-shadow: 0px 0px 2px 0px #f3f3f3;
        background: #fff;
        margin-top: 0.3rem;
    }
    .border-nav a{
        color: #000;
    }
    .pos-pirc{
      position: absolute;
      right: 35px;
      bottom: 10px;
      color: #E93131;
    }
    .width-border-baoc{
      width: 92%;
      margin-left: 4%;
      background: #fff;
      border-radius: 7px;
    }
    .backun-wid-co{
      width: 92%;
      margin-left: 4%;
      display: flex;
      height: 50px;
      line-height: 50px;
      border-bottom: 1px solid #f4f4f4;
    }
    .left-button-p{
      background: #8AB0B4;
      color: #fff;
      border:1px solid #8AB0B4;
      height: 30px;
      border-radius: 10px;
      padding: 1px 10px;
    }
    .right-button-p{
      background: #32B6C6;
      color: #fff;
      border:1px solid #32B6C6;
      height: 30px;
      border-radius: 10px;
      padding: 1px 10px;
    }
    .wid-font-size{
      width: 92%;
      margin-left: 4%;
      font-size: 13px;
      padding-top: 5px;
      padding-bottom: 5px;
      color: #bababa;
    }
    .bouuwid{
        width:92%;
        margin-left: 4%;
        border-bottom: 1px solid #f4f4f4;
        height: 50px;
        line-height: 50px;
        display: flex;
    }
    .bouuwid p{
        width: 50%;
    }
</style>
<style>
.width-border-baoc .vux-no-group-title {
    margin-top: 0 !important;
}
    .vux-label{
        font-size: 14px !important;
    }
    .weui-cell__ft{
        font-size: 14px;
    }
    .weui-cell_access{font-size: 14px;}
      .weui-cells:before {
    border-top: 0px solid #D9D9D9!important;
}
.weui-cells:after {
    border-bottom: 0px solid #D9D9D9!important;
}
.weui-cell:before {
    border-top: 0px solid #D9D9D9!important;
}
</style>